import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;


public class Reservation
{

   public static void main(String[] args) throws IOException
   {
      Scanner input = new Scanner(System.in);
      System.out.println("Welcome to room reservation. \n" +
      		"Press q: to quit\n"+
      		"      r: to read schedule from a file\n");
      
      String line = input.nextLine();
      char c = line.charAt(0);
      switch(c)
      {
         case 'r':ReadFromAFile("input.txt");
         case 'q':System.exit(0);
         default: System.out.println("Invalid command. Please choose again.");
      }
      
    
      
      
     
   }
   
   
   public static void ReadFromAFile(String name) throws IOException
   {
      Scanner input;
      FileReader fReader = new FileReader(name);
      input = new Scanner(fReader);
      while(input.hasNextLine())
      System.out.println(input.nextLine());
      fReader.close();
   }
}
